import { createApp } from 'vue'
import App from './App.vue'
import '@/assets/base.scss'
// 引入element-plus
import element from 'element-plus'
import 'element-plus/dist/index.css'  // 不引入会导致ui样式不正常
// 添加router
import router from './router/index'
//引入pinia
import { createPinia } from 'pinia'
const pinia = createPinia()
//引入持久化插件
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
pinia.use(piniaPluginPersistedstate)
//引入ico图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import './assets/iconfont/iconfont.css'
const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
import zhCn from 'element-plus/es/locale/lang/zh-cn'

app.use(element, {
  locale: zhCn,
})
app.use(router)
app.use(pinia)
app.mount('#app')